Full source code website bán hàng thương mại điện tử gần giống shopee
468.833 lượt xem;
1 <?
2 if (isset($_POST['butSaveLoai'])) {
3 $image = $_POST['txtImage'];
4 $parent = $_POST['txtParent'];
5 $order = $_POST['txtSortOrder'];
6 if($order=='') $order=0;
7 else $order = $_POST['txtSortOrder'];
8
9 $status=($_POST['chkShow']!=''?1:0);
10
11 $CategoryName= trim($_POST['txtName']);
12 if ($CategoryName=="")
13 {
14 echo "<p align=center class='err'>Bạn chưa nhập tên danh mục</p>";
15 }
16 else
17 {
18 $catinfo=GetCatInfo($parent);
19 $language=$catinfo['language'];
20 if (!empty($_POST['oldid'])) {
21 $oldid = $_POST['oldid'];
22 $sql = "update job_cat set name='".$CategoryName."', parent='".$parent."', thutu='".$order."' where id='".$oldid."'";
23 }
24 else
25 $sql = "insert into job_cat (name, parent, thutu) values ('".$CategoryName."','".$parent."','".$order."')";
26 if (mysql_query($sql,$con)) {
27 echo "<p align=center class='err'>Đã cập nhật thành công</p><br>";
28 echo "<script>window.location='index.php?act=cat_job&cat=".$_REQUEST['cat']."&page=".$_REQUEST['page']."'</script>";
29 }
30 else echo "<p align=center class='err'>Không thể cập nhật</p>";
31 }
32 }
33 ?>
34
35 <?
36 if (isset($_GET['id'])) {
37 $oldid=$_GET['id'];
38 $sql = "select * from job_cat where id='".$oldid."'";
39 if ($result = mysql_query($sql,$con)) {
40 $row=mysql_fetch_array($result);
41 $CategoryName=$row['name'];
42 $parent=$row['parent'];
43 $order=$row['thutu'];
44 }
45 }
46 ?>
47
48 <form method="POST" name="FormLoaiSP" action="index.php">
49 <input type=hidden name="act" value="cat_job_m">
50 <input type=hidden name="oldid" value="<? echo $oldid; ?>">
51 <input type=hidden name="page" value="<? echo $_REQUEST['page']; ?>">
52 <input type=hidden name="cat" value="<? echo $_REQUEST['cat']; ?>">
53 <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#0069A8" width="100%" id="AutoNumber1">
54 <tr>
55 <td width="45%" align="center" class="title" height="20">Thêm mới / Cập nhật : Danh mục tuyển dụng</td>
56 </tr>
57 <tr>
58 <td width="45%">
59 <table border="0" cellpadding="4" bordercolor="#111111" width="124%" id="AutoNumber2" cellspacing="0">
60 <tr>
61 <td width="15%" class="smallfont">
62 <p align="right">Tên danh mục</td>
63 <td width="1%" class="smallfont">
64 <font color="#FF0000">*</font></td>
65 <td width="83%" class="smallfont">
66 <INPUT value="<? echo $CategoryName; ?>" TYPE="text" NAME="txtName" CLASS=textbox size="34"></td>
67 </tr>
68 <tr>
69 <td width="15%" class="smallfont">
70 <p align="right">Thuộc danh mục</td>
71 <td width="1%" class="smallfont">
72 </td>
73 <td width="83%" class="smallfont">
74 <select size="1" name="txtParent">
75 <?
76 echo "<option value='0'>[Danh mục gốc]</option>";
77 $cats=GetListJob(0);
78 foreach ($cats as $cat)
79 {
80 if ($cat[0]==$parent)
81 echo "<option value=".$cat[0]." selected>".$cat[1]."</option>";
82 else
83 echo "<option value=".$cat[0].">".$cat[1]."</option>";
84 }
85 ?>
86 </select>
87
88 </td>
89 </tr>
90
91 <tr>
92 <td width="15%" class="smallfont" align="right">
93 Thứ tự sắp xếp</td>
94 <td width="1%" class="smallfont" align="right">
95 </td>
96 <td width="83%" class="smallfont">
97 <INPUT value="<? echo $order; ?>" TYPE="text" NAME="txtSortOrder" CLASS=textbox size="34"></td>
98 </tr>
99 <tr>
100 <td width="15%" class="smallfont">
101 <p align="right">
102 <INPUT TYPE="submit" NAME="butSaveLoai" VALUE="Cập nhật" CLASS=button> </td>
103 <td width="1%" class="smallfont">
104 </td>
105 <td width="83%" class="smallfont"><p align="left"> <INPUT TYPE="reset" CLASS=button value="Nhập lại"></td>
106 </tr>
107 </table>
108 </td>
109 </tr>
110 </table>
111 </form>
2 if (isset($_POST['butSaveLoai'])) {
3 $image = $_POST['txtImage'];
4 $parent = $_POST['txtParent'];
5 $order = $_POST['txtSortOrder'];
6 if($order=='') $order=0;
7 else $order = $_POST['txtSortOrder'];
8
9 $status=($_POST['chkShow']!=''?1:0);
10
11 $CategoryName= trim($_POST['txtName']);
12 if ($CategoryName=="")
13 {
14 echo "<p align=center class='err'>Bạn chưa nhập tên danh mục</p>";
15 }
16 else
17 {
18 $catinfo=GetCatInfo($parent);
19 $language=$catinfo['language'];
20 if (!empty($_POST['oldid'])) {
21 $oldid = $_POST['oldid'];
22 $sql = "update job_cat set name='".$CategoryName."', parent='".$parent."', thutu='".$order."' where id='".$oldid."'";
23 }
24 else
25 $sql = "insert into job_cat (name, parent, thutu) values ('".$CategoryName."','".$parent."','".$order."')";
26 if (mysql_query($sql,$con)) {
27 echo "<p align=center class='err'>Đã cập nhật thành công</p><br>";
28 echo "<script>window.location='index.php?act=cat_job&cat=".$_REQUEST['cat']."&page=".$_REQUEST['page']."'</script>";
29 }
30 else echo "<p align=center class='err'>Không thể cập nhật</p>";
31 }
32 }
33 ?>
34
35 <?
36 if (isset($_GET['id'])) {
37 $oldid=$_GET['id'];
38 $sql = "select * from job_cat where id='".$oldid."'";
39 if ($result = mysql_query($sql,$con)) {
40 $row=mysql_fetch_array($result);
41 $CategoryName=$row['name'];
42 $parent=$row['parent'];
43 $order=$row['thutu'];
44 }
45 }
46 ?>
47
48 <form method="POST" name="FormLoaiSP" action="index.php">
49 <input type=hidden name="act" value="cat_job_m">
50 <input type=hidden name="oldid" value="<? echo $oldid; ?>">
51 <input type=hidden name="page" value="<? echo $_REQUEST['page']; ?>">
52 <input type=hidden name="cat" value="<? echo $_REQUEST['cat']; ?>">
53 <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#0069A8" width="100%" id="AutoNumber1">
54 <tr>
55 <td width="45%" align="center" class="title" height="20">Thêm mới / Cập nhật : Danh mục tuyển dụng</td>
56 </tr>
57 <tr>
58 <td width="45%">
59 <table border="0" cellpadding="4" bordercolor="#111111" width="124%" id="AutoNumber2" cellspacing="0">
60 <tr>
61 <td width="15%" class="smallfont">
62 <p align="right">Tên danh mục</td>
63 <td width="1%" class="smallfont">
64 <font color="#FF0000">*</font></td>
65 <td width="83%" class="smallfont">
66 <INPUT value="<? echo $CategoryName; ?>" TYPE="text" NAME="txtName" CLASS=textbox size="34"></td>
67 </tr>
68 <tr>
69 <td width="15%" class="smallfont">
70 <p align="right">Thuộc danh mục</td>
71 <td width="1%" class="smallfont">
72 </td>
73 <td width="83%" class="smallfont">
74 <select size="1" name="txtParent">
75 <?
76 echo "<option value='0'>[Danh mục gốc]</option>";
77 $cats=GetListJob(0);
78 foreach ($cats as $cat)
79 {
80 if ($cat[0]==$parent)
81 echo "<option value=".$cat[0]." selected>".$cat[1]."</option>";
82 else
83 echo "<option value=".$cat[0].">".$cat[1]."</option>";
84 }
85 ?>
86 </select>
87
88 </td>
89 </tr>
90
91 <tr>
92 <td width="15%" class="smallfont" align="right">
93 Thứ tự sắp xếp</td>
94 <td width="1%" class="smallfont" align="right">
95 </td>
96 <td width="83%" class="smallfont">
97 <INPUT value="<? echo $order; ?>" TYPE="text" NAME="txtSortOrder" CLASS=textbox size="34"></td>
98 </tr>
99 <tr>
100 <td width="15%" class="smallfont">
101 <p align="right">
102 <INPUT TYPE="submit" NAME="butSaveLoai" VALUE="Cập nhật" CLASS=button> </td>
103 <td width="1%" class="smallfont">
104 </td>
105 <td width="83%" class="smallfont"><p align="left"> <INPUT TYPE="reset" CLASS=button value="Nhập lại"></td>
106 </tr>
107 </table>
108 </td>
109 </tr>
110 </table>
111 </form>